#!/bin/bash
set -e  # 启用错误检测
MODULE=$PROJECT_NAME

if [ -n "$MODULE" ]; then
    docker stop $(docker ps -a --filter "name=$MODULE" --format "{{.ID}}") || true
    docker rm $(docker ps -a --filter "name=$MODULE" --format "{{.ID}}") || true
    docker rmi -f $(docker images | grep $MODULE | awk '{print $3}') || true
    echo "==> stop and rm container successfully"
else
    echo 'MODULE为空'
fi
